package com.yh.csx.crm.appapi.controller;

import com.yh.csx.crm.core.entity.CommonResponse;
import com.yh.csx.crm.service.SaleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Huang Zhaoping
 * @date 2019/3/13
 */
@Api("APP销售员")
@RestController
@RequestMapping("/app/sales/")
public class AppSalesController extends BaseController {

    @Autowired
    private SaleService saleService;

    @ApiOperation("检查销售员是否存在")
    @GetMapping("/check")
    public CommonResponse<Boolean> checkSales(String mobile) {
        return CommonResponse.success(saleService.findSalesPermission(mobile) != null);
    }
}
